{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "8be89595-8885-4d5e-b1da-1df04eda5c7a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import { Document, SentenceSplitter } from \"npm:llamaindex\";"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "65de03f9-455a-4c59-9089-093cb6998af7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "  TextNode {\n",
      "    id_: \u001b[32m\"1b2ab25e-562a-4821-bdde-860bd23121c1\"\u001b[39m,\n",
      "    metadata: {},\n",
      "    excludedEmbedMetadataKeys: [],\n",
      "    excludedLlmMetadataKeys: [],\n",
      "    relationships: {\n",
      "      SOURCE: {\n",
      "        nodeId: \u001b[32m\"0cb8de0e-845f-4e73-a7bd-f04426aacfed\"\u001b[39m,\n",
      "        metadata: {},\n",
      "        hash: \u001b[32m\"jatVVXETDFjV2fV1/fbTrdpY6ZGnSYekq9m1X/Ff1qs=\"\u001b[39m\n",
      "      }\n",
      "    },\n",
      "    hash: \u001b[32m\"zVyeDsfMwWH1CqK2269o5uzGWl/DpIWO4ZcVCuyENi4=\"\u001b[39m,\n",
      "    text: \u001b[32m\"I am 10 years old. John is 20 years old.\"\u001b[39m,\n",
      "    metadataSeparator: \u001b[32m\"\\n\"\u001b[39m\n",
      "  }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "const nodeParser = new SentenceSplitter();\n",
    "const nodes = nodeParser.getNodesFromDocuments([\n",
    "    new Document({ text: \"I am 10 years old. John is 20 years old.\" }),\n",
    "]);\n",
    "\n",
    "console.log(nodes);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fc0ec12f-2062-47af-916d-7c77ca39433a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Deno",
   "language": "typescript",
   "name": "deno"
  },
  "language_info": {
   "file_extension": ".ts",
   "mimetype": "text/x.typescript",
   "name": "typescript",
   "nb_converter": "script",
   "pygments_lexer": "typescript",
   "version": "5.3.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
